<!-- toaster directive -->

<toaster-container
        toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->
<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main"><i class="glyphicon glyphicon-log-in"></i> 门禁管理</a></li>
        <li><a ui-sref="main.authm.cardAuth.list" class="active" >授权管理</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>
<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <!-- 头部 -->
        <div class="panel-heading font-bold">
            <a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs"
               ui-sref="main.authm.cardAuth.list">
                <i class="text-md glyphicon glyphicon-chevron-up text-muted"></i>
            </a>
        </div>
        <!--表单-->
        <div class="panel-body" id="AddNewMenber">
            <form class="form-horizontal" name="user_form">
                <!--用户名-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label" for="pname"><span class="text-danger wrapper-sm">*</span>姓名:</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="pname"id="pname"ng-model="pname" disabled ng-click="openPerson()" required>
                    </div>
                    <input type="text" class="form-control" name="personId" ng-hide="true"id="personId" ng-model="record.personId" required>
                </div>
                <!-- -->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label" for="bname"><span class="text-danger wrapper-sm">*</span>楼栋地址:</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="bname"id="bname"disabled required ng-model="bname" ng-click="openDevice()">
                    </div>
                    <input type="text" class="form-control" name="deviceId" ng-hide="true"id="deviceId" ng-model="record.deviceId" required>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>

                <div class="form-group" ng-hide="record.authType=='1'">
                    <label class="col-lg-2 col-sm-3 control-label" for="authNo"><span class="text-danger wrapper-sm">*</span>门禁卡号:</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="authNo"id="authNo" placeholder="请输入门禁卡号..." required ng-model="record.authNo">
                    </div>
                </div>

                <div class="form-group" ng-hide="record.authType=='1'">
                    <label class="col-lg-2 col-sm-3 control-label" for="authType"><span class="text-danger wrapper-sm">*</span>卡类型:</label>
                    <div class="col-sm-6">
                        <select class="form-control" name="authType" id="authType" ng-model="record.authType">
                            <option value="0">身份证</option>
                            <option value="4">居住证</option>
                            <option value="5">IC卡</option>
                        </select>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in" ng-hide="record.authType=='1'"></div>

                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label" for="authType"><span class="text-danger wrapper-sm">*</span>状态:</label>
                    <div class="col-sm-6">
                        <select class="form-control" name="status" ng-model="record.status">
                            <option value="1" ng-selected="1">启用</option>
                            <option value="0">禁用</option>
                        </select>
                    </div>
                </div>

                <!--<div class="form-group">-->
                <!--<label class="col-lg-2 col-sm-3 control-label" for="endTime">-->
                <!--结束时间</label>-->
                <!--<div class="col-sm-6">-->
                <!--<input type="date"  class="form-control" name="endTime" id="endTime" ng-model="record.endTime" format="YYYY-MM-DD">-->
                <!--<span class="help-block m-b-none"></span>-->
                <!--</div>-->
                <!--</div>-->
                <div class="form-group">
                    <label class="col-lg-2 col-sm-3 control-label" for="endTime"><span class="text-danger wrapper-sm">*</span>结束时间:</label>
                    <div class="col-lg-4" style="width: 50%;">
                        <div class="input-group m-d">
                            <input type="text"
                                   class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
                                   name="liveTime" current-text="今天" clear-text="清除" close-text="关闭"
                                   ng-model="record.endTime" datepicker-popup="yyyy-MM-dd"
                                   id="endTime" is-open="endTime" datepicker-options="dateOptions"
                                   placeholder="结束时间" required
                            >
                            <span class="help-block m-b-none"></span>
                            <span class="input-group-btn">
								<button type="button" class="btn btn-default" ng-click="openDatepicker($event,2)">
								<i class="glyphicon glyphicon-calendar"></i>
								</button>
							</span>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <!--btn-->
                <div class="form-group" style="width: 100%">
                    <div class="col-sm-6 col-sm-offset-2 text-center"
                         style="width: 100%;margin: 0;padding: 0;text-align: center">
                        <button type="button" class="btn  w-xs addNew" ng-show="reset" ng-click="resetFrom()">重置</button>
                        <button type="submit" class="btn btn-info w-xs m-l-xl addNew"
                                ng-disabled="isDisabled">保存
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>


<script type="text/ng-template" id="personList.html">
    <!-- 内容区域 -->
    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">

                    <div class="w-auto">
                        <form ng-submit="searchP()" class="form-inline">

                            <div class="form-group" style="width: 30%">
                                <label for="personName">人员姓名：</label>
                                <input type="text" class="form-control" style="width: 180px"id="personName"name="personName"
                                       placeholder="" ng-model="paramP.personName">
                            </div>
                            <div class="form-group"style="width: 30%">
                                <label for="personName">身份证：</label>
                                <input type="text" class="form-control" style="width: 180px"id="IDCardNo"name="IDCardNo"
                                       placeholder="" ng-model="paramP.IDCardNo">
                            </div>

                            <button type="submit" class="btn btn-primary new-primary"style="margin-left: 10px">查询</button>

                        </form>
                    </div>
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th>人员姓名</th>
                            <th>身份证号码</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.personName}}</td>
                            <td class="v-middle">{{item.IDCardNo}}</td>
                            <td class="v-middle">
                                <a ng-click="selectPerson(item.personId,item.personName,item.IDCardNo)">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->

                <!-- 底部分页 -->
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div><!-- /.panel -->
        </div><!-- /.wrapper-data -->

    </div><!-- /.wrapper-md -->
    <div class="modal-footer">
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>

<style scoped>

    .dropdown-menu .btn-danger{padding: 8px 12px;}

    .modal.in .modal-dialog{
        width:1100px;
    }
    .form-group {
        width: 50%;
        float: left;
    }

    .form-group .col-lg-2 {
        width: 25%;
    }

    .form-group .col-lg-4 {
        width: 65%;
    }

    .app-content-body .content{
        margin-top:44px;
    }
</style>
